using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName = "FindByNameTarget-获得指定名字的棋子", menuName = "Skill/Target/FindByNameTarget-获得指定名字的棋子")]
public class FindByNameTarget : TargetSelectorBase
{
    public BaseChessDateSo targetChessDateSo;
    
    public override List<Chess> SelectTargets(Chess chess, GameEvent e)
    {
        if (ChessManager.GetInstance().GetAllChessByName(targetChessDateSo.name).Count > 2)
        {
            var list = new List<Chess>();
            foreach (var c in ChessManager.GetInstance().GetAllChessByName(targetChessDateSo.name))
            {
                list.Add(c);
            }
            return list;
        }
        return null;
    }
}